<!-- Practice_StudentReport_Frame.html -->
<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="yes" name="apple-touch-fullscreen">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,maximum-scale=1, minimum-scale=1, user-scalable=no">
		<title>学生端报告页</title>
		<link rel="stylesheet" type="text/css" href="../../css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="../../css/htmleaf-demo.css">
		<link rel="stylesheet" type="text/css" href="../../css/calendar_common.css">
		<link rel="stylesheet" type="text/css" href="../../css/calendar.css">
		<link rel="stylesheet" type="text/css" href="../../css/swiper-3.3.1.min.css">
		<!--	<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">-->
		<style type="text/css">
			.weui_mask {
				z-index: 11;
			}
			.daily-div {
				background-position: top;
				background-size: 100% 1px;
				background-repeat: no-repeat;
				background-image: linear-gradient(0,#dddddd,#dddddd 50%,transparent 50%);
				background-image: -webkit-linear-gradient(90deg,#dddddd,#dddddd 50%,transparent 50%);
			}
			.daily-div2 {
				background-position: top;
				background-size: 100% 0px;
				background-repeat: no-repeat;
				background-image: linear-gradient(0,#dddddd,#dddddd 50%,transparent 50%);
				background-image: -webkit-linear-gradient(90deg,#dddddd,#dddddd 50%,transparent 50%);
			}
			.daily-content-div {
			}
			.content-div {
				padding: 10px;
				font-size: 14px;
				color: #666;
				user-select: text;
				--webkit-user-select: text;
			}
			.daily-title-div {
				background-size: 100% 1px;
				background-repeat: no-repeat;
				background-position: bottom;
				background-image: linear-gradient(0,#dddddd,#dddddd 50%,transparent 50%);
				background-image: -webkit-linear-gradient(90deg,#dddddd,#dddddd 50%,transparent 50%);
				padding: 10px 10px;
			}
			.daily-title {
				font-size: 16px;
				line-height: 16px;
				color: #333;
				padding-left: 20px;
				/*    border-left: 3px solid #333;*/
				background-size: 16px;
				background-image: url(../../icon/icon_summary_title.png);
				background-position: center left;
				background-repeat: no-repeat;
			}
			.daily-title-comment {
				font-size: 16px;
				line-height: 16px;
				color: #333;
				padding-left: 20px;
				/*    border-left: 3px solid #333;*/
				background-size: 16px;
				background-image: url(../../icon/icon_comment_title.png);
				background-position: center left;
				background-repeat: no-repeat;
			}
			.daily-title-score {
				font-size: 16px;
				line-height: 16px;
				color: #333;
				padding-left: 20px;
				/*    border-left: 3px solid #333;*/
				background-size: 16px;
				background-image: url(../../icon/icon_grade_title.png);
				background-position: center left;
				background-repeat: no-repeat;
			}
			.textarea-div {
				/*margin-top: 20px;*/
				padding: 16px;
				position: relative;
			}
			.textarea-textarea {
				font-size: 14px;
				color: #666;
				width: calc(100% - 32px);
				height: 150px;
				position: absolute;
				top: 16px;
				left: 16px;
				resize: none;
			}
			.textarea-f-div {
				border-radius: 5px;
				-webkit-border-radius: 5px;
				height: 150px;
			}
			.textarea-f-div:before {
				content: "";
				position: absolute;
				top: -50%;
				bottom: -50%;
				left: -50%;
				right: -50%;
				-webkit-transform: scale(0.5);
				transform: scale(0.5);
				border-style: solid;
				border-width: 1px;
				border-color: #999;
				-webkit-border-radius: 10px;
				border-radius: 10px;
				margin: 20px;
			}
			.bottom-div {
				margin-top: 20px;
			}
			.submit-btn {
				height: 40px;
				width: 100%;
				background-color: #18b4ed;
				text-align: center;
				font-size: 14px;
				color: white;
				line-height: 40px;
			}
			.add-monthly-btn-div {
				padding: 10px 60px;
				margin-top: 0px;
			}
			.add-monthly-btn {
				height: 34px;
				width: 100%;
				background-color: #18b4ed;
				text-align: center;
				font-size: 14px;
				color: white;
				line-height: 34px;
				border-radius: 5px;
			}
			.star-content-div {
				padding: 10px 0;
			}
			.star-div img {
				margin-left: 10px;
				width: 18px;
			}
			.icon_right {
				height: 20px;
				position: absolute;
				top: 50%;
				right: 15px;
				/* left: 15px; */
				margin-top: -11px;
			}
		</style>
	</head>
	<body>
	
		<!-- 加载ing -->
		<div class="loading loading1 covers" >
			<div class="loading-bj"></div>
			<p>
				加载中...
			</p>
		</div>
		<!-- 加载ing END -->
		<section class="out-wrap">
			<div class="header-main">
				<section class="header">
					<div class="child return">
						<!-- <i></i> -->
					</div>
					<div class="child date">
						<em class="f34" id="ymym">2016年06月</em>
						<i></i>
					</div>
				</section>
				<section class="day">
					<section class="grid clearfix">
						<div class="day-left clearfix">
							<h1 id="top_shu"></h1>
							<div class="top-contrl">
								<p>
									<em id="top_week"></em>
								</p>
								<div>
									<i id="top_yue"></i>
								</div>
							</div>
						</div>
						<div class="day-right clearfix">
							<div class="yun">
								<span class="js_jin">今</span>
							</div>
						</div>
					</section>
				</section>
				<!-- end day -->
			</div>
			<!-- end header -->
			<section class="content">
				<section class="week">
					<ul class="clearfix f28">
						<li>
							<a href="#">日</a>
						</li>
						<li>
							<a href="#">一</a>
						</li>
						<li>
							<a href="#">二</a>
						</li>
						<li>
							<a href="#">三</a>
						</li>
						<li>
							<a href="#">四</a>
						</li>
						<li>
							<a href="#">五</a>
						</li>
						<li>
							<a href="#">六</a>
						</li>
					</ul>
				</section>
				<section class="calenda">
					<div class="swiper-container">
						<div class="swiper-wrapper">
							<div class="swiper-slide">
								<table id="now1" class="tables">
									<tr class="">
										<td class=" list"><i>12</i><em>中秋</em></td>
									</tr>
								</table>
							</div>
							<div class="swiper-slide">
								<table id="now2" class="tables">
									<tr class="">
										<td class=" list"><i>12</i><em>中秋</em></td>
										<td class=" list"><i>12</i><em>中秋</em></td>
										<td class=" list"><i>12</i><em>中秋</em></td>
										<td class=" list"><i>12</i><em>中秋</em></td>
										<td class=" list"><i>12</i><em>中秋</em></td>
										<td class=" list"><i>12</i><em>中秋</em></td>
										<td class=" list"><i>12</i><em>中秋</em></td>
									</tr>
								</table>
							</div>
							<div class="swiper-slide">
								<table id="now3" class="tables">
									<tr class="">
										<td class="list"><i>12</i><em>中秋</em></td>
									</tr>
								</table>
							</div>
						</div>
					</div>
				</section>
				<!-- end calenda -->
			</section>
			<!-- end content -->
			<section class="prorup"></section>
			<!-- 弹窗 -->
			<div class="tc"></div>
			<div class="tc-innner">
				<h2> 选择日期 </h2>
				<div class="current-time">
					<i class="i-year">1900</i><i class="i-month">1</i><i class="i-date">1</i>
				</div>
				<div class="swiper-box">
					<i class="i1"></i>
					<i class="i2"></i>
					<i class="i3"></i>
					<div class="swiper-box-li">
						<div class="swiper-container2 nbxs">
							<div class="swiper-wrapper year">
								<div class="swiper-slide">
									1900年
								</div>
								<div class="swiper-slide">
									1901年
								</div>
								<div class="swiper-slide">
									1902年
								</div>
								<div class="swiper-slide">
									1903年
								</div>
								<div class="swiper-slide">
									1904年
								</div>
								<div class="swiper-slide">
									1905年
								</div>
								<div class="swiper-slide">
									1906年
								</div>
								<div class="swiper-slide">
									1907年
								</div>
								<div class="swiper-slide">
									1908年
								</div>
								<div class="swiper-slide">
									1909年
								</div>
								<div class="swiper-slide">
									1910年
								</div>
								<div class="swiper-slide">
									1911年
								</div>
								<div class="swiper-slide">
									1912年
								</div>
								<div class="swiper-slide">
									1913年
								</div>
								<div class="swiper-slide">
									1914年
								</div>
								<div class="swiper-slide">
									1915年
								</div>
								<div class="swiper-slide">
									1916年
								</div>
								<div class="swiper-slide">
									1917年
								</div>
								<div class="swiper-slide">
									1918年
								</div>
								<div class="swiper-slide">
									1919年
								</div>
								<div class="swiper-slide">
									1920年
								</div>
								<div class="swiper-slide">
									1921年
								</div>
								<div class="swiper-slide">
									1922年
								</div>
								<div class="swiper-slide">
									1923年
								</div>
								<div class="swiper-slide">
									1924年
								</div>
								<div class="swiper-slide">
									1925年
								</div>
								<div class="swiper-slide">
									1926年
								</div>
								<div class="swiper-slide">
									1927年
								</div>
								<div class="swiper-slide">
									1928年
								</div>
								<div class="swiper-slide">
									1929年
								</div>
								<div class="swiper-slide">
									1930年
								</div>
								<div class="swiper-slide">
									1931年
								</div>
								<div class="swiper-slide">
									1932年
								</div>
								<div class="swiper-slide">
									1933年
								</div>
								<div class="swiper-slide">
									1934年
								</div>
								<div class="swiper-slide">
									1935年
								</div>
								<div class="swiper-slide">
									1936年
								</div>
								<div class="swiper-slide">
									1937年
								</div>
								<div class="swiper-slide">
									1938年
								</div>
								<div class="swiper-slide">
									1939年
								</div>
								<div class="swiper-slide">
									1940年
								</div>
								<div class="swiper-slide">
									1941年
								</div>
								<div class="swiper-slide">
									1942年
								</div>
								<div class="swiper-slide">
									1943年
								</div>
								<div class="swiper-slide">
									1944年
								</div>
								<div class="swiper-slide">
									1945年
								</div>
								<div class="swiper-slide">
									1946年
								</div>
								<div class="swiper-slide">
									1947年
								</div>
								<div class="swiper-slide">
									1948年
								</div>
								<div class="swiper-slide">
									1949年
								</div>
								<div class="swiper-slide">
									1950年
								</div>
								<div class="swiper-slide">
									1951年
								</div>
								<div class="swiper-slide">
									1952年
								</div>
								<div class="swiper-slide">
									1953年
								</div>
								<div class="swiper-slide">
									1954年
								</div>
								<div class="swiper-slide">
									1955年
								</div>
								<div class="swiper-slide">
									1956年
								</div>
								<div class="swiper-slide">
									1957年
								</div>
								<div class="swiper-slide">
									1958年
								</div>
								<div class="swiper-slide">
									1959年
								</div>
								<div class="swiper-slide">
									1960年
								</div>
								<div class="swiper-slide">
									1961年
								</div>
								<div class="swiper-slide">
									1962年
								</div>
								<div class="swiper-slide">
									1963年
								</div>
								<div class="swiper-slide">
									1964年
								</div>
								<div class="swiper-slide">
									1965年
								</div>
								<div class="swiper-slide">
									1966年
								</div>
								<div class="swiper-slide">
									1967年
								</div>
								<div class="swiper-slide">
									1968年
								</div>
								<div class="swiper-slide">
									1969年
								</div>
								<div class="swiper-slide">
									1970年
								</div>
								<div class="swiper-slide">
									1971年
								</div>
								<div class="swiper-slide">
									1972年
								</div>
								<div class="swiper-slide">
									1973年
								</div>
								<div class="swiper-slide">
									1974年
								</div>
								<div class="swiper-slide">
									1975年
								</div>
								<div class="swiper-slide">
									1976年
								</div>
								<div class="swiper-slide">
									1977年
								</div>
								<div class="swiper-slide">
									1978年
								</div>
								<div class="swiper-slide">
									1979年
								</div>
								<div class="swiper-slide">
									1980年
								</div>
								<div class="swiper-slide">
									1981年
								</div>
								<div class="swiper-slide">
									1982年
								</div>
								<div class="swiper-slide">
									1983年
								</div>
								<div class="swiper-slide">
									1984年
								</div>
								<div class="swiper-slide">
									1985年
								</div>
								<div class="swiper-slide">
									1986年
								</div>
								<div class="swiper-slide">
									1987年
								</div>
								<div class="swiper-slide">
									1988年
								</div>
								<div class="swiper-slide">
									1989年
								</div>
								<div class="swiper-slide">
									1990年
								</div>
								<div class="swiper-slide">
									1991年
								</div>
								<div class="swiper-slide">
									1992年
								</div>
								<div class="swiper-slide">
									1993年
								</div>
								<div class="swiper-slide">
									1994年
								</div>
								<div class="swiper-slide">
									1995年
								</div>
								<div class="swiper-slide">
									1996年
								</div>
								<div class="swiper-slide">
									1997年
								</div>
								<div class="swiper-slide">
									1998年
								</div>
								<div class="swiper-slide">
									1999年
								</div>
								<div class="swiper-slide">
									2000年
								</div>
								<div class="swiper-slide">
									2001年
								</div>
								<div class="swiper-slide">
									2002年
								</div>
								<div class="swiper-slide">
									2003年
								</div>
								<div class="swiper-slide">
									2004年
								</div>
								<div class="swiper-slide">
									2005年
								</div>
								<div class="swiper-slide">
									2006年
								</div>
								<div class="swiper-slide">
									2007年
								</div>
								<div class="swiper-slide">
									2008年
								</div>
								<div class="swiper-slide">
									2009年
								</div>
								<div class="swiper-slide">
									2010年
								</div>
								<div class="swiper-slide">
									2011年
								</div>
								<div class="swiper-slide">
									2012年
								</div>
								<div class="swiper-slide">
									2013年
								</div>
								<div class="swiper-slide">
									2014年
								</div>
								<div class="swiper-slide">
									2015年
								</div>
								<div class="swiper-slide">
									2016年
								</div>
								<div class="swiper-slide">
									2017年
								</div>
								<div class="swiper-slide">
									2018年
								</div>
								<div class="swiper-slide">
									2019年
								</div>
								<div class="swiper-slide">
									2020年
								</div>
								<div class="swiper-slide">
									2021年
								</div>
								<div class="swiper-slide">
									2022年
								</div>
								<div class="swiper-slide">
									2023年
								</div>
								<div class="swiper-slide">
									2024年
								</div>
								<div class="swiper-slide">
									2025年
								</div>
								<div class="swiper-slide">
									2026年
								</div>
								<div class="swiper-slide">
									2027年
								</div>
								<div class="swiper-slide">
									2028年
								</div>
								<div class="swiper-slide">
									2029年
								</div>
								<div class="swiper-slide">
									2030年
								</div>
								<div class="swiper-slide">
									2031年
								</div>
								<div class="swiper-slide">
									2032年
								</div>
								<div class="swiper-slide">
									2033年
								</div>
								<div class="swiper-slide">
									2034年
								</div>
								<div class="swiper-slide">
									2035年
								</div>
								<div class="swiper-slide">
									2036年
								</div>
								<div class="swiper-slide">
									2037年
								</div>
								<div class="swiper-slide">
									2038年
								</div>
								<div class="swiper-slide">
									2039年
								</div>
								<div class="swiper-slide">
									2040年
								</div>
								<div class="swiper-slide">
									2041年
								</div>
								<div class="swiper-slide">
									2042年
								</div>
								<div class="swiper-slide">
									2043年
								</div>
								<div class="swiper-slide">
									2044年
								</div>
								<div class="swiper-slide">
									2045年
								</div>
								<div class="swiper-slide">
									2046年
								</div>
								<div class="swiper-slide">
									2047年
								</div>
								<div class="swiper-slide">
									2048年
								</div>
								<div class="swiper-slide">
									2049年
								</div>
							</div>
						</div>
					</div>
					<div class="swiper-box-li">
						<div class="swiper-container3 nbxs">
							<div class="swiper-wrapper month">
								<div class="swiper-slide">
									1月
								</div>
								<div class="swiper-slide">
									2月
								</div>
								<div class="swiper-slide">
									3月
								</div>
								<div class="swiper-slide">
									4月
								</div>
								<div class="swiper-slide">
									5月
								</div>
								<div class="swiper-slide">
									6月
								</div>
								<div class="swiper-slide">
									7月
								</div>
								<div class="swiper-slide">
									8月
								</div>
								<div class="swiper-slide">
									9月
								</div>
								<div class="swiper-slide">
									10月
								</div>
								<div class="swiper-slide">
									11月
								</div>
								<div class="swiper-slide">
									12月
								</div>
							</div>
						</div>
					</div>
					<div class="swiper-box-li">
						<div class="swiper-container4 nbxs">
							<div class="swiper-wrapper date">
								<div class="swiper-slide">
									1日
								</div>
								<div class="swiper-slide">
									2日
								</div>
								<div class="swiper-slide">
									3日
								</div>
								<div class="swiper-slide">
									4日
								</div>
								<div class="swiper-slide">
									5日
								</div>
								<div class="swiper-slide">
									6日
								</div>
								<div class="swiper-slide">
									7日
								</div>
								<div class="swiper-slide">
									8日
								</div>
								<div class="swiper-slide">
									9日
								</div>
								<div class="swiper-slide">
									10日
								</div>
								<div class="swiper-slide">
									11日
								</div>
								<div class="swiper-slide">
									12日
								</div>
								<div class="swiper-slide">
									13日
								</div>
								<div class="swiper-slide">
									14日
								</div>
								<div class="swiper-slide">
									15日
								</div>
								<div class="swiper-slide">
									16日
								</div>
								<div class="swiper-slide">
									17日
								</div>
								<div class="swiper-slide">
									18日
								</div>
								<div class="swiper-slide">
									19日
								</div>
								<div class="swiper-slide">
									20日
								</div>
								<div class="swiper-slide">
									21日
								</div>
								<div class="swiper-slide">
									22日
								</div>
								<div class="swiper-slide">
									23日
								</div>
								<div class="swiper-slide">
									24日
								</div>
								<div class="swiper-slide">
									25日
								</div>
								<div class="swiper-slide">
									26日
								</div>
								<div class="swiper-slide">
									27日
								</div>
								<div class="swiper-slide">
									28日
								</div>
								<div class="swiper-slide">
									29日
								</div>
								<div class="swiper-slide">
									30日
								</div>
								<div class="swiper-slide">
									31日
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="tc-bot">
					<div class="tc-bot-left">
						回到今天
					</div>
					<div class="tc-bot-right">
						确定
					</div>
					<i></i>
				</div>
			</div>
		</section>
		<div class="add-monthly-div">
			<div class="add-monthly-btn-div" onclick="MonthlyReport()" hidden="hidden" id="but_blue">
				<div class="add-monthly-btn" id="addmonthlyid">
					+ 添加月报
				</div>
			</div>
			<div class="add-monthly-btn-div"  hidden="hidden" id="but_gray" hidden="hidden">
				<div class="add-monthly-btn" style="background-color:#D0D0D0 ">
					+ 添加月报
				</div>
			</div>
		</div>
		<div id="main" hidden="hidden">
			<div class="daily-div2" id="tijiao">
				<div class="daily-content-div">
					<div class="daily-title-div">
						<p class="daily-title" id="titleid1">
							总结
						</p>
					</div>
					<div class="textarea-div">
						<div class="textarea-f-div"></div>
						<textarea class="textarea-textarea" placeholder='字数不得少于5个字' id="summary"></textarea>
					</div>
				</div>
			</div>
			<div id="jieguo"  hidden="hidden" >
				<div class="daily-div" >
					<div class="daily-content-div">
						<div class="daily-title-div">
							<p class="daily-title" id="titleid2">
								总结
							</p>
						</div>
						<div class="content-div" id="content">
							<!--	暂无内容-->
						</div>
					</div>
				</div>
				<div class="daily-div" id="commentdivId">
					<div class="daily-content-div">
						<div class="daily-title-div">
							<p class="daily-title-comment">
								评语
							</p>
						</div>
						<div class="content-div" id="comment">
							老师暂无评分
						</div>
					</div>
				</div>
				<div class="daily-div" id="scoredivId">
					<div class="daily-content-div">
						<div class="daily-title-div">
							<p class="daily-title-score">
								评分
							</p>
						</div>
						<div class="star-content-div">
							<div class="star-div" id="xingxingdivid">
								<img src="../../image/icon_xingxingblue01.png">
								<img src="../../image/icon_xingxingblue01.png">
								<img src="../../image/icon_xingxingblue01.png">
								<img src="../../image/icon_xingxingblue01.png">
								<img src="../../image/icon_xingxingblue01.png">
								<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="bottom-div">
				<div class="submit-btn" onclick="UploadData()">
					提交
				</div>
			</div>
		</div>
		<div id="offlineAlert" class="weui_dialog_confirm" style="display: none;">
			<div class="weui_mask"></div>
			<div class="weui_dialog">
				<div class="weui_dialog_hd">
					<strong class="weui_dialog_title">是否放弃在此页面操作？</strong>
				</div>
				<div class="weui_dialog_bd"></div>
				<div class="weui_dialog_ft">
					<a onclick="cleanCancel()" href="#" class="weui_btn_dialog default"  style="color:#18b4ed">取消</a>
					<a onclick="cleanConfirm()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery-1.11.0.min.js"></script>
	<script type="text/javascript" src="../../script/swiper-3.3.1.min.js"></script>
	<script type="text/javascript" src="../../script/calendar_common.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/base64.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/common.js"></script>
	<script src="PracticeStudentRepontJs.js"></script>
	<script type="text/javascript">
		var pid = '';
		//实习计划
		var sxtypes = '';
		//岗位类型
		var daydata = new Array();
		//数组
		var type = '';//0表示选取月份无提交  有提交则返回id
		//是否提交月报
		var summary = '';
		//日报/周报内容
		var lastmonth ='';//-2：表示上个月无学习计划；-1表示上个月在计划内但是未提交；0表示上个月在计划内并且提交
		var startMonthTime = '';//本月第一天
		apiready = function() {
			judgePracticeType();
			setLoaData();
			//提交月报之后刷新数据
			api.addEventListener({
				name : 'RefreshMonthNotifi'
			}, function(ret, err) {
				//coding...
				setLoaData();
			});
		};
		//设置数据
		function setLoaData() {
			var dateData = (new Date()) / 1000;
			var starttime = getYear(dateData) + getMonth(dateData) + "01";
			var endtime = getYear(dateData) + getMonth(dateData) + getMonthLastDay(getMonth(dateData));
			startMonthTime =  getDayTimeStamp(starttime);
			loadData(getDayTimeStamp(starttime), getDayTimeStamp(endtime));
		}

		//设置日历数据
		function setupCalendarData() {
			for (var i = 0; i < daydata.length; i++) {
			
				var data = daydata[i];
				var dayid = getCurrentDay(data.subtime);
				//设置今天数据数据
				var dataday = new Date() / 1000
				var days = getCurrentDay(parseInt(dataday));
				if (dayid == parseInt(days)) {
					showWeek((new Date()));
					SetTodayData(data,i);
				}
	
				if (data.status == 1) {//已经评
					$('#' + dayid).attr("src", "../../image/icon_right.png");
				} else if (data.status == 0) {//未评
					$('#' + dayid).attr("src", "../../image/icon_dot.png");
				} else if (data.status == 2) {//未提交
					var nowday = getCurrentDay((new Date()) / 1000);
					if (dayid <= nowday) {
						
						var dateWeek = new Date(new Date(parseInt(data.subtime) * 1000));
						var weeks = dateWeek.getDay();
						if (weeks == 1 || weeks == 2 || weeks == 3 || weeks == 4) {

							$('#' + dayid).attr('src', "../../image/icon_wrong.png");
						} else if (weeks == 0) {//周末
							var FridayData = daydata[i - 2];
							var SaturdayData = daydata[i - 1];
						
							if (FridayData != undefined && SaturdayData != undefined) {
								if (FridayData.status == 2 && SaturdayData.status == 2) {
									$('#' + dayid).attr("src", "../../image/icon_wrong.png");
								}
							}
						}
					}
				} else if (data.status == 3) {//不在实习期
				}
			}
		}



		//学生端获取实习计划状态（仅限学生端）
		function judgePracticeType() {
			var param = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid')
			};
			cfnetppPOST(urlPracticeType, param, true, function(data, status) {
				if (status == 'success') {
					//1,成功，返回success
					if (data.status == 1) {
						var list = data.json;
						if (list != null && list != '') {
							$("#main").show();
							sxtypes = parseInt(list.sxtypes);
							pid = list.id;
						} else {
							$("#main").hide();
							ShowToast('你还未有实习计划，请等待分配');
						}
					} else if (data.status == -1) {
						$("#main").hide();
						ShowToast('你还未有实习计划，请等待分配');
					} else {
						$("#main").hide();
						ShowToast('你还未有实习计划，请等待分配');
					}
				}
			})
		}

		//获日报信息列表
		function loadData(starttime, endtime) {
			var dateData = parseInt((new Date()) / 1000);
			var dateWeek = new Date(new Date(parseInt(starttime) * 1000));
			var weeks = dateWeek.getDay();
			if (weeks == 0) {//周日
				starttime = starttime - 60 * 60 * 24 * 2;
			} else if (weeks == 6) {
				starttime = starttime - 60 * 60 * 24;
			}
			showProgress();
			pageParam = api.pageParam;
			var params = {
				jid : $api.getStorage('cfnetppjid'),
				uid : $api.getStorage('cfnetppuid'),
				starttime : starttime,
				endtime : endtime,
				present_time : dateData
			};
//				alert(JSON.stringify(params));
			cfnetppPOST(url_getStudentCalendar, params, true, function(data, status) {
//															alert(JSON.stringify(data));
				api.hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						type = data.month_type;
						lastmonth =  data.state;
						daydata = data.data;
						setupCalendarData(); 
						
					
						MonthlyReportStyle(starttime, endtime, dateData);
					} else {
						//					$("#main").hide();
					}
				} else {
					//				$("#main").hide();
				}
			})
		}

		

		//回到今天的数据
		function setBackToday(thisYear, thisMonth, thisDay) {
		
			var m = thisMonth;
			if (thisMonth < 10) {
				m = "0" + thisMonth;
			}
			var d = thisDay;
			if (thisDay < 10) {
				d = "0" + thisDay;
			}
		    var starttime = thisYear + "/" + thisMonth + "/" + "01";
			//			alert(thisYear+"==="+thisMonth+","+thisDay);
			var endtime = thisYear + "/" + m + "/" + getMonthLastDay(getMonth(m));
			var daytime = thisYear + "/" + m + "/" + d;
//						alert(thisMonth+","+ thisDay);
			loadData(getDayTimeStamp(starttime), getDayTimeStamp(endtime));
			setTimeout(function () {setdata(thisYear, thisMonth, thisDay); }, 500);
		}

		//设置数据
		function setdata(y, m, d) {
	
		var starttime=dateOfCompletion2(y, m, 1);
		var starttimes = new Date(starttime);
        
		var weeks = starttimes.getDay();
           var dd = d;
		 if (weeks == 0) {//周日
				var dd = parseInt(d)+2;
			} else if (weeks == 6) {
				var dd = parseInt(d)+1;
			}
			var data = daydata[dd-1];
			var dataday = new Date() / 1000
			var days = getCurrentDay(parseInt(dataday));
			if (data != undefined) {
//            			alert(JSON.stringify( data));
          
				if (data.status == 3) {//不在实习期
					$("#main").hide();
				  if(parseInt(d)!=1){
					ShowToast('你还未有实习计划，请等待分配');
					}
					return;
				
				}
				if (parseInt(dateOfCompletion(y, m, d)) < parseInt(days)) {//查看之前报告
					$("#main").show();
					showWeek(dateOfCompletion2(y, m, d));
					$("#jieguo").show();
					$("#tijiao").hide();
					$(".bottom-div").hide();
					var date = new Date(dateOfCompletion2(y, m, d));
					if (parseInt(data.status) == 2) {//未提交
//						alert(y+"==="+m+","+d);
						$("#commentdivId").hide();
						$("#scoredivId").hide();
						//星期日，星期5，星期6
						if (date.getDay() == 0) {
							$("#main").hide();
							$("#content").html("本周未提交周报");
							var d1 =dd - 1;
							var FridayData = daydata[d1 - 2];
							var SaturdayData = daydata[d1 - 1];
//						
//							alert(JSON.stringify( SaturdayData));
							if (FridayData != undefined && SaturdayData != undefined) {
								if (FridayData.status == 2 && SaturdayData.status == 2) {
									$("#main").show();
								}
							}
						} else if (date.getDay() == 5) {
							$("#content").html("本周未提交周报");
							var d1 = dd - 1;
							var SundayData = daydata[d1 + 2];
							var SaturdayData = daydata[d1 + 1];
							//								alert(SundayData.status+"=="+SaturdayData.status);
							if (SundayData != undefined && SaturdayData != undefined) {
								if ((SundayData.status == 1 || SaturdayData.status == 1) || (SundayData.status == 2 || SaturdayData.status == 2) || (SundayData.status == 0 || SaturdayData.status == 0)) {
									$("#main").hide();
								}
							}
						} else if (date.getDay() == 6) {
							$("#content").html("本周未提交周报");
							var d1 = dd - 1;
							var SundayData = daydata[d1 + 1];
							var FridayData = daydata[d1 - 1];
							if (SundayData != undefined && FridayData != undefined) {
								if ((SundayData.status == 1 || FridayData.status == 1) || (SundayData.status == 2 || FridayData.status == 2) || (SundayData.status == 0 || FridayData.status == 0)) {
									$("#main").hide();
								}
							}
						} else {
							$("#content").html("当天未提交日报");
						}
					} else {
						$("#commentdivId").show();
						$("#scoredivId").show();
						$("#content").html(Base64.decode(data.content));
						if (parseInt(data.status) == 0) {//老师未阅
							$("#comment").html("老师暂无评分");
							$("#xingxingdivid").html(setScoresxingxing(0));
						} else {
							$("#comment").html(Base64.decode(data.comment));
							var scores = parseInt(data.score) / 20;
							$("#xingxingdivid").html(setScoresxingxing(scores));
						}
					}
				} else if (parseInt(dateOfCompletion(y, m, d)) == parseInt(days)) {
				    
					$("#main").show();
					showWeek((new Date()));
//					alert(data.status + "本日");
					if (parseInt(data.status) == 2) {//本日未提交
						$("#jieguo").hide();
						$("#tijiao").show();
						$(".bottom-div").show();
					} else {
						$("#jieguo").show();
						$("#tijiao").hide();
						$(".bottom-div").hide();
						$("#commentdivId").show();
						$("#scoredivId").show();
						$("#content").html(Base64.decode(data.content));
						if (parseInt(data.status) == 0) {//老师未阅
							$("#comment").html("老师暂无评分");
							//							$("#xingxingdivid img").eq(5).prevAll().attr("src", "../../image/icon_xingxingblue01.png");
							$("#xingxingdivid").html(setScoresxingxing(0));
						} else {
							$("#comment").html(Base64.decode(data.comment));
							var scores = parseInt(data.score) / 20;
							//							alert(scores);
							$("#xingxingdivid").html(setScoresxingxing(scores));
						}
					}
				} else {
					$("#main").hide();
				}
			}else{
			if (pid.length == 0) {
			  ShowToast('你还未有实习计划，请等待分配');
			 }
			}
		}

		function setScoresxingxing(scores) {
			var xingxing = '';
			if (scores == 0) {
				xingxing = '<img src="../../image/icon_xingxingblue01.png" >' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
			} else if (scores == 1) {
				xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
			} else if (scores == 2) {
				xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
			} else if (scores == 3) {
				xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
			} else if (scores == 4) {
				xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue01.png">';
			} else if (scores == 5) {
				xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">';
			}
			return xingxing;
		}

		//设置今天数据
		function SetTodayData(data,i) {
			$("#main").show();
//			alert(data.status);
			if (parseInt(data.status) == 2||parseInt(data.status) == 3) {//本日未提交.或者不在实习计划内
				$("#jieguo").hide();
				$("#tijiao").show();
				$(".bottom-div").show();
				var d = i+1;
				setweekstyle(d);
			} else {
//									alert("提交");
				$("#jieguo").show();
				$("#tijiao").hide();
				$(".bottom-div").hide();
				$("#commentdivId").show();
				$("#scoredivId").show();
				$("#content").html(Base64.decode(data.content));
				if (parseInt(data.status) == 0) {//老师未阅
					$("#comment").html("老师暂无评分");
					$(".star-div img").eq(5).prevAll().attr("src", "../../image/icon_xingxingblue01.png");
				} else {
					$("#comment").html(Base64.decode(data.comment));
					var scores = parseInt(data.score) / 20;
					$(".star-div img").eq(scores).prevAll().attr("src", "../../image/icon_xingxingblue.png");
				}
			}
		}
       //设置周末状态
		function setweekstyle(d) {
	     var weeks = new Date(new Date(parseInt(startMonthTime) * 1000)).getDay();
		   if (weeks == 0) {//周日
		    var d = d;
		   } else if (weeks == 6) {
		    var d = d-1;
		   }
		var date = new Date();
           
		     $("#main").hide();
			//星期日，，星期6
			if (date.getDay() == 0) {
				var d1 = d - 1;
				var FridayData = daydata[d1 - 2];
				var SaturdayData = daydata[d1 - 1];
				if (FridayData != undefined && SaturdayData != undefined) {
					if (FridayData.status == 2 && SaturdayData.status == 2) {
						$("#main").show();
					}
				}
			} else if (date.getDay() == 5) {//星期5

						$("#main").show();

			} else if (date.getDay() == 6) {//星期6
                  $("#main").show();
				var d1 = d - 1;
				var SundayData = daydata[d1 + 1];
				var FridayData = daydata[d1 - 1];
				if ( FridayData != undefined) {

					if ( FridayData.status == 0|| FridayData.status == 1) {//提交
						$("#main").hide();
					}
				}
			}else{//周一到周四
			  	$("#main").show();
			
			}
		}
		//年月日转成时间搓 2018/04/06
		function getDayTimeStamp(time) {
			//	alert(time);
			var startdate = new Date(time);
			return Date.parse(startdate) / 1000;
		}

		// 获取月份数最后1天 m:月份
		function getMonthLastDay(m) {
			var days = '31';
			if (parseInt(m) % 2 == 0) {//偶数
				if (parseInt(m) == 2) {
					days = '28';
				}
				days = '30';
			}
			return days;
		}

		//时间戳转换
		function getCurrentDay(ns) {
			var date = new Date(parseInt(ns) * 1000);
			var Y = date.getFullYear() + "-";
			var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
			var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
			var hd1 = Y + M + D;
			var hd = hd1.replace(/-/g, '');
			return hd;
		}

		//获取年
		function getYear(ns) {
			var date = new Date(parseInt(ns) * 1000);
			var Y = date.getFullYear() + '/';
			return Y
		}

		//获取月
		function getMonth(ns) {
			var date = new Date(parseInt(ns) * 1000);
			var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/';
			return M
		}

		//获取日
		function getDay(ns) {
			var date = new Date(parseInt(ns) * 1000);
			var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
			return D
		}

		//日期补全
		function dateOfCompletion(b, c, i) {
			var c1 = parseInt(c);
			if (c1 < 10) {
				c1 = "0" + c;
			};
			var i1 = parseInt(i);
			if (i1 < 10) {
				i1 = "0" + i;
			};
			var hb1 = b + "-" + c1 + "-" + i1;
			var rq = hb1.replace(/-/g, '');
			return rq;
		}

		//日期补全
		function dateOfCompletion2(b, c, i) {
			var c1 = parseInt(c);
			if (c1 < 10) {
				c1 = "0" + c;
			};
			var i1 = parseInt(i);
			if (i1 < 10) {
				i1 = "0" + i;
			};
			var hb1 = b + "/" + c1 + "/" + i1;
			return hb1;
		}

		//提交日报/周报
		function UploadData() {
			var date = new Date();
			if (date.getDay() == 0) {
				//week = "星期日"
				UploadWeekData();
			} else if (date.getDay() == 1) {
				UploadDayData();
				// week = "星期一"
			} else if (date.getDay() == 2) {
				UploadDayData();
				//week = "星期二"
			} else if (date.getDay() == 3) {
				UploadDayData();
				// week = "星期三"
			} else if (date.getDay() == 4) {
				// week = "星期四"
				UploadDayData();
			} else if (date.getDay() == 5) {
				//week = "星期五"
				UploadWeekData();
			} else if (date.getDay() == 6) {
				//week = "星期六"
				UploadWeekData();
			}
		}

		//日报
		function UploadDayData() {
			if (pid.length == 0) {
				ShowToast('你还未有实习计划，请等待老师分配');
				return;
			}
			sendBuriedNotifi('1', '学生端提交日报', '089');
			summary = $('#summary').val();
			var weeklytime = (new Date()) / 1000;
			if (summary.length == 0) {
				ShowToast('提交信息不完整，请完善信息后再次提交');
			} else if (summary.length < 5) {
				ShowToast('字数不得小于5个字');
			} else if (summary.length > 5000) {
				ShowToast('字数不得大于5000个字');
			} else {
				showProgress();
				var params = {
					uid : $api.getStorage('cfnetppuid'),
					//					uid : 144575,
					jid : $api.getStorage('cfnetppjid'),
					weeklytime : parseInt(weeklytime),
					summary : Base64.encode(summary),
					pid : pid,
					message : '日报'
				};
				//					alert(JSON.stringify(params));
				cfnetppPOST(urlTjdaily, params, false, function(data, status) {
					//alert(JSON.stringify(data));
					SendBusinessOperationsLogNotifi('学生端提交日报', '089', params, params, '', data, '学生端提交日报接口', '089-01')
					hideProgress();
					if (status == 'success') {
						//1,成功，返回success
						if (data.status == 1) {
							ShowToast('提交成功');
							setLoaData();
							//2,您本月已提交过日报,返回has
						} else if (data.status == 2) {
							ShowToast('你今日已提交过日报!');
							//3,您处于未实习状态,返回job
						} else if (data.status == 3) {
							ShowToast('您处于未实习状态，暂不能提交日报!');
							//4,实习时间已经到期,返回end
						} else if (data.status == 4) {
							ShowToast('你本次实习已经结业啦，不用再提交了!');
							//5,你选择的提交时间不在实习期间,返回sxtime
						} else if (data.status == 5) {
							ShowToast('你选择的提交时间不在实习期间');
						} else {
							ShowToast(data.message);
						}
					} else {
						ShowToast('网络异常,请检查网络!');
					}
				});
			}
		}

		//提交周报
		function UploadWeekData() {
			sendBuriedNotifi('1', '学生端提交周报', '092');
			var weeklytime = (new Date()) / 1000;
			if (pid.length == 0) {
				ShowToast('你还未有实习计划，请等待老师分配');
				return;
			}
			summary = $('#summary').val();
			if (summary.length == 0) {
				ShowToast('提交信息不完整，请完善信息后再次提交');
			} else if (summary.length < 5) {
				ShowToast('字数不得小于5个字');
			} else if (summary.length > 5000) {
				ShowToast('字数不得大于5000个字');
			} else {
				showProgress();
				var param = {
					uid : $api.getStorage('cfnetppuid'),
					jid : $api.getStorage('cfnetppjid'),
					weeklytime : parseInt(weeklytime),
					summary : Base64.encode(summary),
					weekplan : '',
					pid : pid,
					message : '周报'
				};
				cfnetppPOST(urlAddact, param, false, function(data, status) {
					hideProgress();
					SendBusinessOperationsLogNotifi('学生端提交周报', '092', param, param, '', data, '提交周报接口', '092-01')
					if (status == 'success') {
						//1,成功，返回success
						if (data.status == 1) {
							ShowToast('提交成功');
			
							setLoaData();
							//2,您本月已提交过月报,返回has
						} else if (data.status == 2) {
							ShowToast('您本周已提交过周报!');
							//3,您处于未实习状态,返回job
						} else if (data.status == 3) {
							ShowToast('您处于未实习状态，暂不能提交周报!');
							//4,实习时间已经到期,返回end
						} else if (data.status == 4) {
							ShowToast('你本次实习已经结业啦，不用再提交了!');
							//5,你选择的提交时间不在实习期间,返回sxtime
						} else if (data.status == 5) {
							ShowToast('你选择的提交时间不在实习期间');
						} else {
							ShowToast(data.message);
						}
					} else {
						ShowToast('网络异常,请检查网络!');
					}
				});
			}
		}

		//月报显示样式
		function MonthlyReportStyle(starttime, enddaytime, dateData) {
			var enddaytime1 = enddaytime + 60 * 60 * 24;//次月第一天
			var before7Day = enddaytime - 60 * 60 * 24 * 5;//最后7天的第一天
			
			var after7Day = starttime + 60 * 60 * 24 * 7;//前7天的的第7天
	
			var dateData = (new Date()) / 1000;
//			alert("before7Day =="+before7Day);
//			alert("enddaytime1 =="+enddaytime1);
//			alert("after7Day =="+after7Day);
			if ((parseInt(starttime) < parseInt(dateData) && parseInt(dateData) < parseInt(after7Day))) {//次月头7天可点击提交月报
		       	if (lastmonth == -1) {//上个月未提交
				    $("#but_gray").hide();
					$("#but_blue").show();
			    }else{
				     $("#but_blue").hide();
					 $("#but_gray").show();
			    }
			}else if( (parseInt(before7Day) < parseInt(dateData) && parseInt(dateData) < parseInt(enddaytime1))){//月底最后7天
			   $("#but_gray").hide();
			   $("#but_blue").show();
			} else {//未在规定时间
                 $("#but_blue").hide();
				 $("#but_gray").show();
			}
			if (parseInt(type) > 0) {//本月提交过月报
			    $("#but_gray").hide();
				$("#but_blue").show();
				$("#addmonthlyid").html("查看月报");
			} 
		}

		//判断是否提交月报
		function MonthlyReport() {
			if (parseInt(type) == 0) {//未提交
				addMonthlyReport();
			} else {//提交
				MonthlyReportInfo(type);
			}
		}

		//提交月报
		function MonthlyReportInfo(monthid) {
			api.openWin({useWKWebView:true,
				name : 'Student_submitMouthReportFrameDetail',
				url : '../TrainReport/Student_submitMouthReportFrameDetail.html',
				pageParam : {
					monthid : monthid,
					sxtypes : sxtypes,
					sourceurl : window.location.pathname,
					sourcetitle : document.title
				},
				allowEdit : true
			});
		}

		//提交月报
		function addMonthlyReport() {
			var sourceurl = window.location.pathname;
			var sourcetitle = document.title;
			var DataParam = {
				sourceurl : sourceurl,
				sourcetitle : sourcetitle
			};
			api.openWin({useWKWebView:true,
				name : 'Student_WriteMonthReport',
				url : '../TrainReport/Student_WriteMonthReport.html',
				pageParam : DataParam,
				allowEdit : true
			});
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		//显示是本日总结/本周总结
		function showWeek(ns) {
			var date = new Date(ns);
			//星期日，星期5，星期6
			if (date.getDay() == 0 || date.getDay() == 5 || date.getDay() == 6) {
				$("#titleid1").html("本周总结");
				$("#titleid2").html("本周总结");
			} else {
				$("#titleid1").html("本日总结");
				$("#titleid2").html("本日总结");
			}
		}
		
	</script>
	</body>
</html>